motorcycles = ['honda', 'yamaha', 'suzuki']
print(motorcycles)
print('=======================')

# 修改列表元素
motorcycles[0] = 'ducati'
print(motorcycles)
print('=======================')

# 末尾添加列表元素
motorcycles.append('ducati')
print(motorcycles)

print('=======================')
motorcycles = []
motorcycles.append('NO1')
motorcycles.append('NO2')
motorcycles.append('NO3')
print(motorcycles)
print('=======================')

# 插入元素
motorcycles.insert(0, 'ducati')
print(motorcycles)
print('=======================')

# 根据位置来删除列表的元素
del motorcycles[2]
print(motorcycles)

# pop 删除元素
last_owned = motorcycles.pop()
print("The last motorcycle I owned was a " + last_owned.title() + '.')
print(motorcycles)
first_owned = motorcycles.pop(0)
print("The first motorcycle I owned was a " + first_owned.title() +".")
motorcycles.append('NO1')
motorcycles.append('NO2')
motorcycles.append('NO3')
print(motorcycles)

print("=================================")

# remove() 只删除第一个指定的值
motorcycles = ['honda', 'yamaha', 'suzuki', 'ducati']
print(motorcycles)
motorcycles.remove('ducati')
print(motorcycles)

print("=================================")
motorcycles = ['honda', 'yamaha', 'suzuki', 'ducati']
print(motorcycles)
too_expensive = 'ducati'
motorcycles.remove(too_expensive)
print(motorcycles)
print("\nA " + too_expensive + 'is too expensive fo me .')


print("=================")

# 嘉宾名单
peoples = ['hong', 'guan', 'bai', 'huan']
one = 'hong'
#peoples.remove(one)
print(one + '无法过来')
peoples[0] = 'xia'
print(peoples)
peoples.insert(0, 'jia')
print(peoples)
i = len(peoples)
print(i)
peoples.insert(int(i/2), 'dong')
print(peoples)
peoples.append('hua')
print(peoples)
peoples.pop()
peoples.pop()
peoples.pop()
peoples.pop()
peoples.pop()
print(peoples)
del peoples[0]
del peoples[0]
print(peoples)
